﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UIBase
{
    public GameObject gameObject;
    public Transform transform;
    public RectTransform RectTrans;
    public E_UILayer Layer;
    public string Path;
    public bool CanMulti;
    public UIBase()
    {
 
        Layer = E_UILayer.Normal;
        CanMulti = false;
        SetInfo();
      
        
    }
    public void InitGameObject()
    {
    }
    public void Open(object param=null)
    {
        if(gameObject==null)
        UIMgr.Instance.CreateGO(this);
        OnOpen(param);
        UpdateInfo();
        Show();
    }
    public virtual void Show(object param = null)
    {
        
    }
    public virtual void Hide()
    {
        if (gameObject != null)
            gameObject.SetActive(false);
    }
    public virtual void UpdateInfo()
    { }
    public virtual void SetInfo()
    {
        
    }
    public virtual void OnOpen(object param = null)
    { }

}


public enum E_UILayer
{
    BackGround,
    Normal,
    PopUp,
    Tip,
    Top
}